package avicit.im.lantop.userauthset.service.api;


import avicit.cbb.businessclass.system.dataauth.domain.CbbAuthResource;
import avicit.cbb.techclass.tabledefine.commtablemanager.domain.CbbTabColumns;
import avicit.im.lantop.userauthset.domain.LantopQualificationDetail;
import avicit.im.lantop.userauthset.domain.LantopUserAuthCondition;
import avicit.im.lantop.userauthset.domain.LantopUserAuthExtendData;
import avicit.im.lantop.userauthset.domain.LantopUserAuthSetExtend;
import avicit.platform6.commons.utils.web.TreeNode;
import avicit.platform6.core.rest.msg.ResponseMsg;
import avicit.platform6.core.restclient.RestClient;
import avicit.platform6.core.restclient.RestClientUtils;
import com.github.pagehelper.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Component
public class UserAuthServiceApi {


    /**
     * 服务编码
     */
    private static final String SERVICE_CODE = "filebasicmanager";

    private static final String BASE_PATH = "/api/avicit/im/lantop/userauthset/rest/UserAuthServiceRest";

    @Autowired
    private RestClient restClient;


    /**
     *根据ids获取用户权限设置数据
     * @param page
     * @param userName
     * @param orgId
     * @param id
     */
    public void getUsers(Page<Map<String, Object>> page, String userName, String orgId, String id) {
        String url = BASE_PATH + "/getUsers";
        Map<String,Object> map = new HashMap<>();
        map.put("page",page);
        map.put("userName",userName);
        map.put("orgId",orgId);
        map.put("id",id);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });

    }

    /**
     * 获取用户权限设置信息数量：用于判断是否可以批量设置操作权限
     * @param cbbAuthResourceIds
     * @return
     */
    public int getLantopUserAuthSetExtendByResourceId(String cbbAuthResourceIds) {
        String url = BASE_PATH + "/getLantopUserAuthSetExtendByResourceId";
        Map<String, Object> map = new HashMap<>();
        map.put("cbbAuthResourceIds", cbbAuthResourceIds);
        ResponseMsg<Integer> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<Integer>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }

    /**
     * 加载不包含relTargetId的操作权限分类
     * @param relTargetId
     * @return
     */
    public List<Map<String, Object>> getLantopOperateClassList(String relTargetId) {
        String url = BASE_PATH + "/getLantopOperateClassList";
        Map<String, Object> map = new HashMap<>();
        map.put("relTargetId", relTargetId);
        ResponseMsg<List<Map<String, Object>>> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<List<Map<String, Object>>>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }

    /**
     * 保存新增条件
     * @param param
     */
    public void saveQualification(Map<String, Object> param) {
        String url = BASE_PATH + "/saveQualification";
        Map<String, Object> map = new HashMap<>();
        map.put("param", param);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });

    }

    /**
     * 保存用户权限设置条件扩展信息
     * @param luacs
     * @param parameter
     */
    public void insertLantopUserAuthConditions(List<LantopUserAuthCondition> luacs, Map<String, Object> parameter) {
        String url = BASE_PATH + "/insertLantopUserAuthConditions";
        Map<String, Object> map = new HashMap<>();
        map.put("luacs", luacs);
        map.put("parameter",parameter);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }

    /**
     *保存条件权限明细信息
     * @param qualificationDetailList
     * @param param2
     */
    public void saveLantopQualificationDetail(List<Map<String, Object>> qualificationDetailList, Map<String, String> param2) {
        String url = BASE_PATH + "/saveLantopQualificationDetail";
        Map<String, Object> map = new HashMap<>();
        map.put("qualificationDetailList", qualificationDetailList);
        map.put("param2",param2);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }

    /**
     * 加载操作权限分类
     * @param page
     * @param relTargetId
     */
    public void getSetOperatreClass(Page<Map<String, Object>> page, String relTargetId) {
        String url = BASE_PATH + "/getSetOperatreClass";
        Map<String, Object> map = new HashMap<>();
        map.put("page", page);
        map.put("relTargetId",relTargetId);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }

    /**
     * 根据ids获取用户权限设置数据
     * @param param
     * @return
     */
    public List<Map<String, Object>> getCbbAuthResourceDatasByNodeId(Map<String, Object> param) {
        String url = BASE_PATH + "/getCbbAuthResourceDatasByNodeId";
        Map<String, Object> map = new HashMap<>();
        map.put("param", param);
        ResponseMsg<List<Map<String, Object>>> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<List<Map<String, Object>>>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }

    /**
     * 加载用户权限设置信息扩展对象
     * @param cbbAuthResourceId_search
     * @return
     */
    public LantopUserAuthSetExtend getLantopUserAuthSetExtend(String cbbAuthResourceId_search) {
        String url = BASE_PATH + "/getLantopUserAuthSetExtend";
        Map<String, Object> map = new HashMap<>();
        map.put("cbbAuthResourceId_search", cbbAuthResourceId_search);
        ResponseMsg<LantopUserAuthSetExtend> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<LantopUserAuthSetExtend>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }

    /**
     * 删除用户权限设置信息扩展记录
     * @param id
     */
    public void delLantopUserAuthSetExtend(String id) {
        String url = BASE_PATH + "/delLantopUserAuthSetExtend";
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }

    /**
     * 新增用户权限设置信息扩展记录
     * @param newLantopUserAuthSetExtend
     */
    public void insertLantopUserAuthSetExtend(LantopUserAuthSetExtend newLantopUserAuthSetExtend) {
        String url = BASE_PATH + "/insertLantopUserAuthSetExtend";
        Map<String, Object> map = new HashMap<>();
        map.put("newLantopUserAuthSetExtend", newLantopUserAuthSetExtend);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }

    /**
     * 获取不包含用户ID为targetId的所有用户
     * @param page
     * @param targetId
     * @param searchMap
     */
    public void getAllUser(Page<Map<String, Object>> page, String targetId, Map<String, Object> searchMap) {
        String url = BASE_PATH + "/getAllUser";
        Map<String, Object> map = new HashMap<>();
        map.put("page", page);
        map.put("targetId",targetId);
        map.put("searchMap",searchMap);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }

    /**
     * 获取targetId用户所有权限记录
     * @param orgId
     * @param deptId
     * @param sysId
     * @param targetId
     * @return
     */
    public List<LantopUserAuthSetExtend> getLantopUserAuthSetExtend(String orgId, String deptId, String sysId, String targetId) {
        String url = BASE_PATH + "/getLantopUserAuthSetExtend/v1";
        Map<String, Object> map = new HashMap<>();
        map.put("orgId", orgId);
        map.put("deptId",deptId);
        map.put("sysId",sysId);
        map.put("targetId",targetId);
        ResponseMsg<List<LantopUserAuthSetExtend>> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<List<LantopUserAuthSetExtend>>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }

    /**
     *获取targetId用户所有权限记录
     * @param orgId
     * @param deptId
     * @param sysId
     * @param targetId
     * @return
     */
    public List<LantopUserAuthExtendData> getLantopUserAuthExtendData(String orgId, String deptId, String sysId, String targetId) {
        String url = BASE_PATH + "/getLantopUserAuthExtendData";
        Map<String, Object> map = new HashMap<>();
        map.put("orgId", orgId);
        map.put("deptId",deptId);
        map.put("sysId",sysId);
        map.put("targetId",targetId);
        ResponseMsg<List<LantopUserAuthExtendData>> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<List<LantopUserAuthExtendData>>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }

    /**
     * 保存复制到目标用户
     * @param orgId
     * @param deptId
     * @param sysId
     * @param lantopUserAuthSetExtends
     * @param lantopUserAuthExtendDatas
     * @param cbbAuthResources
     * @param targetUserIds
     */
    public void saveCopyToTargetUser(String orgId, String deptId, String sysId, List<LantopUserAuthSetExtend> lantopUserAuthSetExtends, List<LantopUserAuthExtendData> lantopUserAuthExtendDatas, List<CbbAuthResource> cbbAuthResources, String targetUserIds) {
        String url = BASE_PATH + "/saveCopyToTargetUser";
        Map<String, Object> map = new HashMap<>();
        map.put("orgId", orgId);
        map.put("deptId",deptId);
        map.put("sysId",sysId);
        map.put("lantopUserAuthSetExtends",lantopUserAuthSetExtends);
        map.put("lantopUserAuthExtendDatas",lantopUserAuthExtendDatas);
        map.put("cbbAuthResources",cbbAuthResources);
        map.put("targetUserIds",targetUserIds);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }

    /**
     * 保存复制到目标用户(保存授权资源信息,更新用户权限设置信息扩展)
     * @param orgId
     * @param deptId
     * @param targetId
     * @param cbbAuthResources
     * @param targetUserIds
     */
    public void saveCbbAuthResourceAndUpdateSetExtendByUserIds(String orgId, String deptId, String targetId, List<CbbAuthResource> cbbAuthResources, String targetUserIds) {
        String url = BASE_PATH + "/saveCbbAuthResourceAndUpdateSetExtendByUserIds";
        Map<String, Object> map = new HashMap<>();
        map.put("orgId", orgId);
        map.put("deptId",deptId);
        map.put("targetId",targetId);
        map.put("cbbAuthResources",cbbAuthResources);
        map.put("targetUserIds",targetUserIds);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }

    /**
     * 获取用户下的所有节点  (20160711 add wangzp)
     * @param orgId
     * @param deptId
     * @param sysId
     * @param targetId
     * @return
     */
    public String getClassNodeIds(String orgId, String deptId, String sysId, String targetId) {
        String url = BASE_PATH + "/getClassNodeIds";
        Map<String, Object> map = new HashMap<>();
        map.put("orgId", orgId);
        map.put("deptId",deptId);
        map.put("sysId",sysId);
        map.put("targetId",targetId);
        ResponseMsg<String> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<String>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }

    /**
     * 删除复制权限数据(数据回滚操作)
     * @param orgId
     * @param deptId
     * @param targetId
     * @param targetUserIds
     */
    public void deleteAuthCopyDataByRollBack(String orgId, String deptId, String targetId, String targetUserIds) {
        String url = BASE_PATH + "/deleteAuthCopyDataByRollBack";
        Map<String, Object> map = new HashMap<>();
        map.put("orgId", orgId);
        map.put("deptId",deptId);
        map.put("targetUserIds",targetUserIds);
        map.put("targetId",targetId);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });

    }

    /**
     * 加载档案数据
     * @param param
     * @return
     */
    public List<Map<String, Object>> getArchiveClass(Map<String, Object> param) {
        String url = BASE_PATH + "/getArchiveClass";
        Map<String, Object> map = new HashMap<>();
        map.put("param", param);
        ResponseMsg<List<Map<String, Object>>> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<List<Map<String, Object>>>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }

    /**
     * 获取条件权限明细
     * @param id
     * @return
     */
    public List<LantopQualificationDetail> getLantopQualificationDetails(String id) {
        String url = BASE_PATH + "/getLantopQualificationDetails";
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        ResponseMsg<List<LantopQualificationDetail>> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<List<LantopQualificationDetail>>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }

    /**
     * 获取角色信息
     * @param page
     * @param name
     * @param orgId
     */
    public void getUserRoleList(Page<Map<String, Object>> page, String name, String orgId) {
        String url = BASE_PATH + "/getUserRoleList";
        Map<String, Object> map = new HashMap<>();
        map.put("page", page);
        map.put("name",name);
        map.put("orgId",orgId);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }

    /**
     * 保存条件权限明细
     * @param lantopQualificationDetail
     */
    public void saveLantopQualifcicationDetail(LantopQualificationDetail lantopQualificationDetail) {
        String url = BASE_PATH + "/saveLantopQualifcicationDetail";
        Map<String, Object> map = new HashMap<>();
        map.put("lantopQualificationDetail", lantopQualificationDetail);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }

    /**
     * 删除条件权限明细信息
     * @param id
     */
    public void delLantopQualificationDetail(String id) {
        String url = BASE_PATH + "/delLantopQualificationDetail";
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }


    /**
     * 加载电子文件待选择条目
     * @param page
     * @param param
     */
    public void getElectronicWaitSelectEntry(Page<Map<String, Object>> page, Map<String, Object> param) {
        String url = BASE_PATH + "/getElectronicWaitSelectEntry";
        Map<String, Object> map = new HashMap<>();
        map.put("page", page);
        map.put("param",param);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }


    /**
     *
     * @param page
     * @param param
     */
    public void getNotElectronicWaitSelectEntry(Page<Map<String, Object>> page, Map<String, Object> param) {
        String url = BASE_PATH + "/getNotElectronicWaitSelectEntry";
        Map<String, Object> map = new HashMap<>();
        map.put("page", page);
        map.put("param",param);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }


    /**
     * 加载已设置权限条目
     * @param page
     * @param param
     */
    public void getAuthEntry(Page<Map<String, Object>> page, Map<String, Object> param) {
        String url = BASE_PATH + "/getAuthEntry";
        Map<String, Object> map = new HashMap<>();
        map.put("page", page);
        map.put("param",param);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }


    /**
     * 保存条目权限设置
     * @param lantopUserAuthExtendDatas
     * @param parameter
     */
    public void saveAuthEntry(List<LantopUserAuthExtendData> lantopUserAuthExtendDatas, Map<String, Object> parameter) {
        String url = BASE_PATH + "/saveAuthEntry";
        Map<String, Object> map = new HashMap<>();
        map.put("lantopUserAuthExtendDatas", lantopUserAuthExtendDatas);
        map.put("parameter",parameter);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }


    /**
     * 通过节点id获取数据授权信息
     * @param nodeIds
     * @return
     */
    public List<Map<String, Object>> getUserAuthExtendDatasByNodeId(String nodeIds) {
        String url = BASE_PATH + "/getUserAuthExtendDatasByNodeId";
        Map<String, Object> map = new HashMap<>();
        map.put("nodeIds", nodeIds);
        ResponseMsg<List<Map<String, Object>>> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<List<Map<String, Object>>>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }


    /**
     * 删除条目权限设置
     * @param ids
     */
    public void delAuthEntry(String ids) {
        String url = BASE_PATH + "/delAuthEntry";
        Map<String, Object> map = new HashMap<>();
        map.put("ids", ids);
        ResponseMsg<List<Map<String, Object>>> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<List<Map<String, Object>>>>() {
        });
    }


    /**
     *加载功能操作权限菜单树
     * @param id
     * @return
     */
    public List<TreeNode> getMenuTreeNode(String id) {
        String url = BASE_PATH + "/getMenuTreeNode";
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        ResponseMsg<List<TreeNode>> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<List<TreeNode>>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }


    /**
     *加载模块下资源
     * @param parameter
     * @return
     */
    public List<Map<String, Object>> getResource(Map<String, Object> parameter) {
        String url = BASE_PATH + "/getResource";
        Map<String, Object> map = new HashMap<>();
        map.put("parameter", parameter);
        ResponseMsg<List<Map<String, Object>>> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<List<Map<String, Object>>>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }


    /**
     * 保存操作权限设置
     * @param cbbAuthResources
     * @param parameter
     */
    public void saveFuncResourceConfig(List<CbbAuthResource> cbbAuthResources, Map<String, Object> parameter) {
        String url = BASE_PATH + "/saveFuncResourceConfig";
        Map<String, Object> map = new HashMap<>();
        map.put("cbbAuthResources", cbbAuthResources);
        map.put("parameter",parameter);
        ResponseMsg<List<Map<String, Object>>> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<List<Map<String, Object>>>>() {
        });

    }


    /**
     *
     * @param param
     * @return
     */
    public List<Map<String, Object>> getUserAuthDatasByParam(Map<String, Object> param) {
        String url = BASE_PATH + "/getUserAuthDatasByParam";
        Map<String, Object> map = new HashMap<>();
        map.put("param", param);
        ResponseMsg<List<Map<String, Object>>> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<List<Map<String, Object>>>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }


    /**
     * 取出数据结点的类型  (20160708 add wangzp)
     * @param id
     * @return
     */
    public String getClassNodeType(String id) {
        String url = BASE_PATH + "/getClassNodeType";
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        ResponseMsg<String> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<String>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }


    /**
     * 获取条件信息数量
     * @param targetType
     * @param targetId
     * @param lantop_auth_server_userset
     * @param id
     * @return
     */
    public int getLantopUserAuthSetExtendCount(String targetType, String targetId, String lantop_auth_server_userset, String id) {
        String url = BASE_PATH + "/getLantopUserAuthSetExtendCount";
        Map<String, Object> map = new HashMap<>();
        map.put("targetType", targetType);
        map.put("targetId",targetId);
        map.put("lantop_auth_server_userset",lantop_auth_server_userset);
        map.put("id",id);
        ResponseMsg<Integer> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<Integer>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }


    /**
     * 保存权限资源配置
     * @param cbbAuthResources
     * @param parameter
     */
    public void saveResourceConfig(List<CbbAuthResource> cbbAuthResources, Map<String, Object> parameter) {
        String url = BASE_PATH + "/saveResourceConfig";
        Map<String, Object> map = new HashMap<>();
        map.put("cbbAuthResources", cbbAuthResources);
        map.put("parameter",parameter);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }


    /**
     * 角色下所有用户
     * @param page
     * @param targetName
     * @param orgIdentity
     */
    public void getRoleUser(Page<Map<String, Object>> page, String targetName, String orgIdentity) {
        String url = BASE_PATH + "/getRoleUser";
        Map<String, Object> map = new HashMap<>();
        map.put("page", page);
        map.put("targetName",targetName);
        map.put("orgIdentity",orgIdentity);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }


    /**
     * 部门下所有用户
     * @param page
     * @param targetId
     * @param orgIdentity
     */
    public void getDetpUser(Page<Map<String, Object>> page, String targetId, String orgIdentity) {
        String url = BASE_PATH + "/getDetpUser";
        Map<String, Object> map = new HashMap<>();
        map.put("page", page);
        map.put("targetId",targetId);
        map.put("orgIdentity",orgIdentity);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }


    /**
     * 根据用户ID获取用户
     * @param page
     * @param targetId
     * @param orgIdentity
     */
    public void getUser(Page<Map<String, Object>> page, String targetId, String orgIdentity) {
        String url = BASE_PATH + "/getUser";
        Map<String, Object> map = new HashMap<>();
        map.put("page", page);
        map.put("targetId",targetId);
        map.put("orgIdentity",orgIdentity);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }


    /**
     * 岗位下所有用户
     * @param page
     * @param targetId
     * @param orgIdentity
     */
    public void getPositionUser(Page<Map<String, Object>> page, String targetId, String orgIdentity) {
        String url = BASE_PATH + "/getPositionUser";
        Map<String, Object> map = new HashMap<>();
        map.put("page", page);
        map.put("targetId",targetId);
        map.put("orgIdentity",orgIdentity);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }


    /**
     * 删除权限
     * @param orgId
     * @param deptId
     * @param sysId
     * @param targetType
     * @param targetId
     * @param codes
     */
    public void delAuthSet(String orgId, String deptId, String sysId, String targetType, String targetId, String codes) {
        String url = BASE_PATH + "/delAuthSet";
        Map<String, Object> map = new HashMap<>();
        map.put("orgId", orgId);
        map.put("deptId",deptId);
        map.put("sysId",sysId);
        map.put("targetType",targetType);
        map.put("targetId",targetId);
        map.put("codes",codes);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }


    /**
     *删除已设置角色
     * @param lantopUserAuthSetExtend
     * @param delTargetIds
     * @param delTargetNames
     */
    public void delRoleSet(LantopUserAuthSetExtend lantopUserAuthSetExtend, String delTargetIds, String delTargetNames) {
        String url = BASE_PATH + "/delRoleSet";
        Map<String, Object> map = new HashMap<>();
        map.put("lantopUserAuthSetExtend", lantopUserAuthSetExtend);
        map.put("delTargetIds",delTargetIds);
        map.put("delTargetNames",delTargetNames);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg>() {
        });
    }
}
